home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: cs.vu.nl!mlassche
- From: mlassche@cs.vu.nl (Lassche MA)
- Subject: Simple Question seeks simple answer
- Nntp-Posting-Host: galjoen.cs.vu.nl
- Sender: news@cs.vu.nl
- Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
- Date: Mon, 15 Apr 1996 10:19:29 GMT
- X-Newsreader: TIN [version 1.2 PL2]
- Message-ID: <DpwFCI.xu.0.-s@cs.vu.nl>
-
- I'm skipping from 16bit to 32bit, there are some minor problems which I
- cannot solve nor does the 'whelp cguide'.
-
- In 16 bits it was common practice to do the well known string copy
- something like
- mov es,x
- mov di,y
- mov cx,z
- mov es:[di],x1
- rep movsd.
-
- When I tried something similair in 32 bits my watcom compiler complained
- that 'es' was an 'illegal register' (very strange since it is mentioned in
- the cguide). 'Well' I thought 'Why use es at all we now have an 'EDI'.' But
- this resulted in something not quite right.
- the code was I think
- #pragma aux Fill_Screen_White = \
- "MOV EDI,0A0000H" \
- "MOV CX,16000" \
- "MOV [EDI],15" \
- "REP MOVSD" \
- modify [ EDI CX ];
-
- Question [(1)] how to do a string copy 32 bits - wise ?
-
- Something which looks the same.
-
- To get the VESA info you've got to call int 10H with arguments AH = 4fh
- and AL = 00H and ES:DI being the pointer to put the junk. Once more
- how's this done in 32 bit.
-
- I've tried a non asm approach. The usual SREGS, REGS call.
-
-
- 16 bit version, tested and worked.
-
- struct Vesa_info
- {
- bla...bla...bla
- }
-
- Vesa_info V;
- union REGS Registers;
- struct SREGS Segment_Registers;
-
- Registers.w.ax = 4f00h;
- Registers.w.di = FP_OFF(&V);
- Segment_Registers.es = FP_SEG(&V);
-
- int86x(10H, &Registers, &Registers, &Segment_Registers);
-
- For the 32 bit version I invented the same code exept int86x = int386x.
-
- This resulted in either the subtle crash of my p5 or a total empty Vesa_info
- struct ( my video card supports Vesa - the 16 bit version proved that ).
-
- Any bright ideas people ?
-
-
- Finaly does anyone know a optimize-em-up site, that is some basic optimization
- tricks for assembly code ?
-
-
- Please reply to my email.
-
- Regards,
- MArk
-
- mlassche@cs.vu.nl
-
- Keywords:
-
-
-